<template>
  <div id="app">
    <Upload></Upload>
    <ap></ap>
    <!-- <input type="text" v-model="test"> -->
    <!-- <img alt="Vue logo" src="./assets/logo.png" /> -->
    <!-- <HelloWorld msg="Welcome to Your Vue.js App" /> -->
    <!-- <test :test='test' :img='img' :obj='obj' :day='day' :someObject='someObject'></test> -->
    <!-- <A></A> -->
    <!-- <el-button @click="testAlert">one</el-button> -->
    <!-- <check-box v-model="cbox" trueValue='0' falseValue='1'>测试BOX</check-box>
    <div @click="wt">{{cbox}}</div>-->

    <!-- <div id="container"></div>
    <div id="panel"></div>
    <el-button @click="initMap" size="mini">创建</el-button>
    <el-button @click="destroyMap" size="mini">销毁</el-button>
    <el-image :src='im'></el-image>
    <ls-tables></ls-tables> -->
    <!-- <div class="infinite-list" v-infinite-scroll="load" style="overflow:auto;height: 80px;">
      <div>
        <div v-for="i in count" class="infinite-list-item" :key="i">{{ i }}</div>
      </div>
    </div> -->
  </div>
</template>

<script>
import lsVideo from './components/lsVideo'
import im from './assets/applyForBanner.jpg'
import lsTables from "./view/table-render";
import HelloWorld from "./components/HelloWorld.vue";
import Test from "./components/test.vue";
import A from "./components/compA.vue";
import checkBox from "./components/checkbox/checkbox";
import unit from "./components/unit.vue";
import IInput from "./components/input/input";
import Upload from './components/upload/upload'
import ap from './components/newB/ap'
import {
  findComponentUpward,
  findComponentDownward,
  findComponentsDownward
} from "./utils/assist";
export default {
  provide() {
    return {
      lApp: this
    };
  },
  data() {
    return {
      im: im,
      count: 0,
      cbox: false,
      test: "test msg",
      img: {
        imgList: {
          url:
            "https://sun-1253313441.cos.ap-chengdu.myqcloud.com/images/1569398263222"
        }
      },
      obj: { arr: [{ name: "asdas" }] },
      day: [{ p: "pp" }],
      someObject: { a: "a" },
      firstInitMap: {
        // 是否可以旋转
        rotateEnable: true,
        // 是否可以抖斜
        pitchEnable: true,
        //
        resizeEnable: true,
        // zoom: 11,
        // Y轴的角度
        pitch: 65,
        center: [116.397428, 39.90923],
        // 开启3D视图,默认为关闭
        viewMode: "3D",
        // 属于X轴旋转
        rotation: "-15",
        // true表示可以缩放到最小值，false就不能 是否可以缩放到20的等级
        expandZoomRange: true,
        // 楼块出现是否带动画
        buildingAnimation: true,
        zooms: [13, 20]
        // lang: 'en'
      },
      map: null,
      scale: null,
      toolBar: null,
      controlBar: null,
      district: null,
      driving: null,
      // 下四个表示 区域面，道路，建筑物，标注
      features: ["bg", "road", "building", "point"],
      opts: {
        subdistrict: 0,
        extensions: "all",
        level: "city"
      }
    };
  },
  created() {
    // this.$nextTick(() => {
    //   this.initMap();
    //   this.initLoadEnd();
    // });
  },
  mounted() {
    // const find = findComponentDownward(this, "comp");
    // const find = findComponentsDownward(this, "comp");
    // console.log(find, "findComponentDownward");
    // console.log(this.testss(), "testss");
  },
  methods: {
    initLoadEnd() {
      this.map &&
        this.map.on("complete", function() {
          // window.alert("地图加载完成！");
        });
    },
    // 销毁
    destroyMap() {
      this.map && this.map.destroy();
    },
    wt() {
      this.cbox = !this.cbox;
    },
    testss() {
      var arr = [];
      return arr.reduce((per, item) => {
        console.log("for in");
        return item;
      }, []);
    }
  },
  name: "comp",
  components: {
    ap,
    Upload,
    HelloWorld,
    Test,
    A,
    checkBox,
    unit,
    IInput,
    lsTables,
    lsVideo
  }
};
</script>

<style>
/* #app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
#container {
  width: 800px;
  height: 800px;
  margin-left: 200px;
}
#panel {
  width: 200px;
  height: 800px;
  position: absolute;
  top: 50px;
  right: 100px;
} */
</style>
